﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Content;

namespace CGShaderIntegration
{
    class HesseSebastianMoon
    {
        private Model moon;   
        private Effect moonEffect;
        private TextureCube moonTexture;
       

        public HesseSebastianMoon(ContentManager Content)
        {
            moon = Content.Load<Model>("models\\HesseSebastianMond");
            moonTexture = Content.Load<TextureCube>("textures\\HesseSebastianMoonCubeMap");
            moonEffect = Content.Load<Effect>("effects\\HesseSebastianMoonEffect");            
        }

      
            public void Draw(Matrix world, Matrix view, Matrix projection)
        {
            foreach (ModelMesh mesh in moon.Meshes)
            {               
                 foreach (ModelMeshPart part in mesh.MeshParts)
                 {
                        part.Effect = moonEffect;                       
                        part.Effect.Parameters["World"].SetValue(world);
                        part.Effect.Parameters["View"].SetValue(view);
                        part.Effect.Parameters["Projection"].SetValue(projection);
                        part.Effect.Parameters["moonTexture"].SetValue(moonTexture);                
                }
                mesh.Draw();           
            }
        }
        
    }
}
